﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EfCore.Configers
{
    public class SSDConfigers : IEntityTypeConfiguration<SSD>
    {
        public void Configure(EntityTypeBuilder<SSD> builder)
        {
            // 指定表名
            builder.ToTable(nameof(SSD));

            // 配置主键
            builder.HasKey(e => e.SdtId);

            // 配置自动增长列
            builder.Property(e => e.SdtId).ValueGeneratedOnAdd();

            // 其他属性配置
            builder.Property(e => e.StandardName).HasMaxLength(100);
            builder.Property(e => e.ItemName).HasMaxLength(100);
        }
    }
}
